-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #9261 - Use decimal symbol configured in system and user #10495
Conversation
b4656a4
to
8100b37
Compare
Hello @SinergiaCRM! Thanks for so many contributions in the recent days! Could you, please, remove comments in templateParser.php file: Thanks in advance! Regards, |
8100b37
to
2996649
Compare
Hello @serhiisamko091184, comments deleted 👍 Regards!! |
@SinergiaCRM, many thanks for the quick reply and the changes made! Regards, |
2996649
to
9567164
Compare
Hi, we have detected that it also occurs with float type fields so we have added the appropriate changes in the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
Now using System-set values on Emails and User-set values on PDFs.
I have noticed that this issue is also present for currency-type fields,
see this email:
For the above, I have set:
System Thousand: "X" + System Decimal: "Z"
User Thousand: "." + User Decimal: ","
And the custom Currency->Amount Field is using the user's settings.
However, as this PR resolves the issue for both Decimal and Float, I'm happy to approve as-is.
Thank you again!
Description
This PR fixes the decimal separator symbol for a decimal or float value obtained from a database not being parsed correctly when incorporated into an email template or PDF template.
To do this, a generic function is created in the PR with a parameter where you can indicate which configuration to use: the system configuration (configured by default) or the user configuration. This function will be used in the operation of parsing the PDF template or the email template.
Our proposal is to use the system configuration for sending emails and the user configuration for using the PDF template.
Motivation and Context
How To Test This
Create a decimal and a float fields in a contact module
Set a symbol to separate decimals in user profile and system configuration.
Create a contact-based email template that contains the decimal and float fields.
Create a campaign and use the previous template.
Send a email and check that in the sent email, the decimal and float values is being parsed with the configured system decimal symbol
Create a workflow based on Contacts and edit a Contact that has a value in the decimal and float fields for the workflow to send the email with the previous template
Check that in the sent email, the decimal and float value is being parsed with the configured system decimal symbol
Create a PDF template based on Contact and include the decimal and float fields
Generate a PDF file of a contact that has a value in the decimal field and
check that the decimal symbol is applied in the generated PDF template
Types of changes
Final checklist